package com.hdu.controller.contentManagement;

import com.hdu.pojo.Result;
import com.hdu.service.ICourseCategoryService;
import com.hdu.vo.CourseCategoryTreeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@Api(value = "课程分类相关接口", tags = "课程分类相关接口")
public class CourseCategoryController {
    @Resource
    private ICourseCategoryService courseCategoryService;

    @ApiOperation("课程分类相关接口")
    @GetMapping("/course-category/tree-nodes/{id}")
    public Result<List<CourseCategoryTreeVo>> queryTreeNodes(@PathVariable("id") String id) {
        return Result.success(courseCategoryService.queryTreeNodes(id));
    }
}
